#include"tcp_server.hpp"
#include<memory>

using namespace std;
using namespace ns_server;

static void usage(char proc[])
{
   cout << "Usage:\n\t" << proc << " port"<< endl;
}

string echoServer(string message)
{
    return message;
}

int main(int argc,char *argv[])
{
    if(argc!=2)
    {
        usage(argv[0]);
        exit(USAGE_ERR);
    }
    uint16_t port=atoi(argv[1]);

    unique_ptr<tcpServer> ts(new tcpServer(port,echoServer));
    ts->Init();
    ts->Start();


    return 0;
}